package cn.com.cetccst.tools.network;

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class Wifi {
    @SuppressLint("HardwareIds")
    public static String getMacAddress(Context context) {
        WifiManager wifi = (WifiManager)
                context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
        WifiInfo info;
        if (wifi != null) {
            info = wifi.getConnectionInfo();
            if (info != null) {
                return info.getMacAddress();
            }
        }
        return "";
    }
}
